package com.example.demo.controller;


import com.example.demo.bean.StudentVO;
import com.example.demo.entity.Student;
import com.example.demo.mapper.StudentMapper;
import com.example.demo.service.impl.StudentServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 自动
 * @since 2019-01-14
 */
@RestController
@RequestMapping("/student")
public class StudentController {
    @Autowired
    StudentServiceImpl studentService;

    @GetMapping(value = "/list")
    public void getAll() {
        List<Student> list = studentService.list();
        System.out.println("list : " + list.toString());
    }


    @GetMapping(value = "/more")
    public void getmore() {
        List<StudentVO> scoreById = studentService.getScoreById("1");
        //List<Student> list = studentService.list();
        System.out.println("scoreById : " + scoreById.toString());
    }


    @GetMapping(value = "/page")
    public void getPage() {
        List<Student> stu = studentService.getSPage();
        //List<Student> list = studentService.list();
        System.out.println("stu : " + stu.toString());
    }


}
